<template>
	<view>
		<view class="u-content">
			<!-- <view class="box"><button @click="share()" type="primary">分享</button></view> -->
			<!-- <text v-html="doc.DocContent"></text> -->
			<u-parse :html="doc.DocContent" :tag-style="style"></u-parse>
			<!-- <view class="Category">{{ RecordDetail.Category }}</view> -->
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from 'vuex';
	export default {
		components: {},
		data() {
			return {
				doc: {},
				style: {
					// 字符串的形式
					// p: 'color: gray;font-size:45rpx',
					span: 'font-size: 40rpx'
				}
			};
		},
		onLoad(options) {
			if (!this.hasLogin()) {
				this.reLogin()
			}
			this.hasLogin();
			let url = '';
			if (options.type === '1') {
				url += `/api/GetGoldStcDetail/`+options.id;
			} else {
				url += `/api/GetFileDetail/`+options.id;
			}
			// url += `${options.id}?userCode=${this.userCode}&token=${this.token}`;
			let opt = {
				url
			}
			let param = {
				userCode: this.userCode,
				token: this.token
			}
			this.$request.httpRequest(opt, param).then(e => {
				this.doc = e.data;
				// console.log(e.data);
				uni.setNavigationBarTitle({
					title: this.doc.DocTitle
				});
			}).catch(e => {
				uni.hideLoading();
				// console.log(e);
			})
		},
		computed: {
			...mapState(['token', 'userCode'])
		},
		methods: {
			...mapActions(['hasLogin', 'reLogin']),
		}
	};
</script>

<style lang="scss" scoped>
	.u-content {
		padding: 18rpx;
		font-size: $font-max;
		// text-indent: 50upx;
	}
</style>
